package com.pc_project.controller;

import com.pc_project.service.impl.MailServiceImpl;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author iceberg-work
 */
@RestController
@RequestMapping("/ams/mail")
public class MailController {
    @Autowired
    MailServiceImpl mailService;

    @GetMapping("/sendSimpleMail")
    @ApiOperation("简单邮件发送")
    public void sendSimpleMail(String from, String to, String subject, String text) {
        mailService.sendSimpleMail(from,
                to,
                subject,
                text);
        /**
         * 例子
         *   mailService.sendSimpleMail("xxx@qq.com",
         *                 "xxx@qq.com",
         *                 "测试",
         *                 "测试文本");
         */
    }
}
